# xiaoming_dict = {"name":"小明"}
# # 取值
# print(xiaoming_dict["name"])
# print(f'最初的Id={id(xiaoming_dict)}')
# # print(xiaoming_dict.get("name123")),会显示none，不会报错
# # 增加、修改
# xiaoming_dict["age"]=18
# print(xiaoming_dict["age"])
# xiaoming_dict["name"]="小小明"
# print(xiaoming_dict)
# # 删除
# xiaoming_dict.pop("name")
# print(xiaoming_dict)
#
#
#
# # 统计长度
# print(len(xiaoming_dict))
# # 合并字典
# temp_dict={"height":1.75,"age":18}
# xiaoming_dict.update(temp_dict)
# print(xiaoming_dict)
#
# # 遍历
# def use_dict_iter():
#     xiaoming_dict={"name":"xiaoming",
#                    "qq":"12345",
#                    "phone":"10086"}
#     for key in xiaoming_dict:
#         print(key,xiaoming_dict[key])
#     for k,v in xiaoming_dict.items():
#         print(k,v)
# use_dict_iter()

def use_list_dict():
    '''列表嵌套字典'''
    card_list=[{"name":"张三",
                "QQ":"12345",
                "phone":"10086"},
               {"name":"李四",
                "QQ":"12345",
                "phone":"10086"},]
    for card in card_list:
        for k,v in card.items():
            print(k,v)
        print(card)
    use_list_dict()